from .http import get, post
from schema.device import DeviceSchema

# 获取设备信息
def getDevice(id:str):
    res = get('/device/get/{0}'.format(id))
    # print(res['status'])
    if(res['status']):
        return res['data']
    else:
        print('getDevice：', res['message'])
        return None

# 添加设备
def addDevice(device:DeviceSchema):
    res = post('/device/add',device)
    # print(res['status']) 
    if(res['status']):
        return True
    else:
        print('addDevice：', res['message'])
        return False


